import java.util.Arrays;
import java.util.Comparator;

public class myComparator implements Comparator<Integer> {
    @Override
    public int compare(Integer a, Integer b) {
        return b- a;
    }
    public static void main(String[] args) {
        Integer[] array = {5, 2,7, 1, 3};
        Arrays.sort(array, new myComparator());

        for (Integer num :array) {
            System.out.print(num + " ");
        }
    }
}
